< previous page page_953 next page >

Page 953
3. Modify the cmdAdd_Click procedure as shown below to set the focus on the ISBN field when the Add button is pressed.
Private Sub cmdAdd_Click()
   datTitles.Recordset.AddNew  ' Add a new record to the table
   txtISBN.SetFocus  ' Set the focus to the txtISBN control
End Sub
Day 2
Answers to Day 2 Quiz
1. The three main building blocks of relational databases are data fields, data records, and data tables.
2. The smallest building block in a relational database is the data field.
3. A data record is a collection of related data fields.
4. The main role of a primary key in a data table is to maintain the internal integrity of a data table.
5. A data table can have any number of foreign keys defined. It can, however, have only one primary key defined.
6. There are only two values that can be stored in a BOOLEAN data field: 1 (true) and 0 (false).
7. The highest value that can be stored in a BYTE field is 255. Visual Basic allows users to enter up to 32767 without reporting an error, but any value higher than 255 is truncated to a single-byte value.
8. Any attempt to edit and update a counter field results in a Visual Basic error.
9. The CURRENCY data type can store up to four places to the right of the decimal. Any data beyond the fourth place is truncated by Visual Basic without reporting an error.
10. You can use the International applet from the Windows Control Panel to determine the display format of DATE data fields.
Answers to Day 2 Exercises
1. There are three records in the table.
2. The SSN (Social Security Number) would make an excellent primary key for this table because it would be unique for all records entered.

 
< previous page page_953 next page >

If you like this book, buy it!